<!DOCTYPE html>
<html>

	<head>

		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>注册后台账号</title>
		<meta name="keywords" content="">
		<meta name="description" content="">
		<link rel="shortcut icon" href="favicon.ico">
		<link href="__STATIC__/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
		<link href="__STATIC__/css/font-awesome.css?v=4.4.0" rel="stylesheet">
		<!-- jqgrid-->
		<link href="__STATIC__/css/plugins/jqgrid/ui.jqgrid.css?0820" rel="stylesheet">
		<link href="__STATIC__/css/animate.css" rel="stylesheet">
		<link href="__STATIC__/css/style.css?v=4.1.0" rel="stylesheet">
		<link href="__STATIC__/css/tool.css" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="__STATIC__/css/t_c.css" />
		<link rel="stylesheet" type="text/css" href="__STATIC__/css/statistics.css" />
		<link rel="stylesheet" type="text/css" href="__STATIC__/css/information.css" />
		<link href="__STATIC__/css/new_file.css" rel="stylesheet">
		<style type="text/css">
			.form-grouzj {
				width: 190px !important;
			}
			
			.tool_text {
				width: 150px;
				padding: 0px;
				margin-left: -80px;
			}
		</style>
	</head>

	<body class="gray-bg">
		<div class="wrapper wrapper-content  animated fadeInRight">
			<div class="row">
				<div class="col-sm-12">
					<div class="ibox ">
						<div class="ibox-title">
							<h5>注册后台账号</h5>
						</div>
						<div class="toogl_body">
							<div class="toogl_tale">
								<a href="{:url('account_details')}"><input type="button" value="账号详情" class="btn btn-w-m btn-default"></a>
								<a href="{:url('account_registered')}"><input type="button" value="注册账号" class="btn btn-w-m btn-info"></a>
								<a href="{:url('account_operation')}"><input type="button" value="操作记录" class="btn btn-w-m btn-default"></a>
							</div>
							<br/>
							<div class="acc-reg">
								<div class="">
									<div class="form-group form-group-tool">
										<label class="recor-red">*</label>
										<label class="control-label">账　号：</label>
										<input type="text" placeholder="请输入账号" id="noticeTitle" class="form-control">
									</div>
									<div class="form-group form-group-tool">
										<label class="recor-red">*</label>
										<label class="control-label">姓　名：</label>
										<input type="text" placeholder="请输入姓名" id="noticeTitle1" class="form-control">
									</div>
									<div class="form-group form-group-tool">
										<label class="recor-red">*</label>
										<label class="control-label">手机号：</label>
										<input type="text" placeholder="手机号" id="noticeTitle2" class="form-control">
									</div>
									<div class="form-group form-group-1 form-group-0 form-grouzj">
										<label class="recor-red">*</label>
										<label class="control-label">账号类型：</label>
										<select id="con_1">
											<option value="">请选择类型</option>
										</select>
									</div><br/>
									<div id="form_fd" class="form-group form-group-1 form-group-0 form-grouzj">
										<input type="button" value="选择区域" class="btn btn-info" data-toggle="modal" data-target="#myModal" id="form_game">　
										<input type="button" value="选择游戏" class="btn btn-info" data-toggle="modal" data-target="#myModal2" id="form_game"/>　
										<input type="button" value="提交" class="btn btn-info" onclick="_checkedPost()" style="width: 100%;"/>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 弹出  详情   -->
		<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div id="gray_Nr">
				<div class="col-sm-4 acco-tc">
					<div class="ibox float-e-margins float-e-margins-xiao">
						<div class="ibox-title">
							<h5>选择区域</h5>
							<div class="ibox-tools" data-dismiss="modal">
								<a class="close-link">
									<i class="fa fa-times"></i>
								</a>
							</div>
						</div>
						<div class="province_bod">
							<div class="province_1" id="province" style="width: 100%">
								<p class="province_top">选择区域</p>
							</div>
						</div>
						<div class="ibox-butz">
							<input class="btn btn-w-m " type="button" id="all" style="background-color:#B4CDCD" value="全选">
							<input class="btn btn-w-m " type="button" id="Uall" style="background-color:#A9A9A9" value="取消全选">
							<input class="btn btn-w-m btn-info" type="button" id="button_ban_user" data-dismiss="modal" value="确定">
							<input class="btn btn-w-m" type="button" data-dismiss="modal" id="cancel" value="取消">
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--弹出end  详情-->
		<!-- 弹出  详情   -->
		<div id="myModal2" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div id="gray_Nr">
				<div class="col-sm-4 acco-tc">
					<div class="ibox float-e-margins float-e-margins-xiao">
						<div class="ibox-title">
							<h5>选择游戏</h5>
							<div class="ibox-tools" data-dismiss="modal">
								<a class="close-link">
									<i class="fa fa-times"></i>
								</a>
							</div>
						</div>
						<div class="province_bod">
							<div class="province_1" id="game" style="width: 100%">
								<p class="province_top">选择游戏</p>
							</div>
						</div>
						<div class="ibox-butz">
							<input class="btn btn-w-m " type="button" id="alls" style="background-color:#B4CDCD" value="全选">
							<input class="btn btn-w-m " type="button" id="Ualls" style="background-color:#A9A9A9" value="取消全选">
							<input class="btn btn-w-m btn-info" type="button" id="button_ban_users" data-dismiss="modal" value="确定">
							<input class="btn btn-w-m" type="button" data-dismiss="modal" id="cancels" value="取消">
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--手机导航-->
		<div class="to-fdh" style="display: none;">
			<img class="to-imgd" src="__STATIC__/img/phonedh.jpg">
			<div class="mob-nrlb">
				<ul>
					<li>
						<a class="mob-nrdh">管理</a>
						<ul class="mob-nryc">
							<li class="mob-nrdhli">
								<a href="{:url('Player/gameplayer')}">玩家管理</a>
							</li>
							<li class="mob-nrdhli">
								<a href="{:url('system/notice')}">公告管理</a>
							</li>
							<li class="mob-nrdhli">
								<a href="{:url('email/mail')}">邮件管理</a>
							</li>
							<li class="mob-nrdhli">
								<a href="{:url('Club/club')}">亲友圈管理</a>
							</li>
							<li class="mob-nrdhli">
								<a href="{:url('Money/money')}">提现管理</a>
							</li>
							<li class="mob-nrdhli">
								<a href="{:url('Order/order')}">订单管理</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="mob-nrdh">数据</a>
						<ul class="mob-nryc">
							<li class="mob-nrdhli">
								<a href="{:url('data/datagk')}">概況</a>
							</li>
							<li class="mob-nrdhli">
								<a href="{:url('data/datawf')}">玩法</a>
							</li>
							<li class="mob-nrdhli">
								<a href="{:url('data/datalc')}">留存</a>
							</li>
							<li class="mob-nrdhli">
								<a href="{:url('data/datass')}">实时数据</a>
							</li>
							<li class="mob-nrdhli">
								<a href="{:url('data/dataczfx')}">充值分析</a>
							</li>
							<li class="mob-nrdhli">
								<a href="{:url('data/dataclub')}">亲友圈统计</a>
							</li>
							<li class="mob-nrdhli">
								<a href="{:url('data/president')}">高级会长</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="mob-nrdh mob-qbh">权限</a>
						<ul class="mob-nryc">
							<li class="mob-nrdhli">
								<a href="{:url('rule/rule_list')}">权限管理</a>
							</li>
							<li class="mob-nrdhli">
								<a href="{:url('rule/rule_group')}">用户组管理</a>
							</li>
							<li class="mob-nrdhli">
								<a href="{:url('account/account_details')}">后台账号管理</a>
							</li>
						</ul>
					</li>
				</ul>
			</div>
		</div>
		<div class="vnl-zz" style="display:none">
			<div><img src="__STATIC__/img/bqhp.gif"></div>
		</div>
		<!--手机适配-->
		<script src="__STATIC__/js/jquery.min.js?v=2.1.4"></script>
		<script src="__STATIC__/js/bootstrap.min.js?v=3.3.6"></script>
		<script src="__STATIC__/js/content.js?v=1.0.0"></script>
		<script src="__STATIC__/js/plugins/validate/jquery.validate.min.js"></script>
		<script src="__STATIC__/js/plugins/validate/messages_zh.min.js"></script>
		<!--<script src="__STATIC__/js/demo/form-validate-demo.js"></script>-->
		<script src="__STATIC__/js/plugins/jqgrid/i18n/grid.locale-cn.js?0820"></script>
		<script src="__STATIC__/js/plugins/jqgrid/jquery.jqGrid.min.js?0820"></script>
		<script src="__STATIC__/js/plugins/peity/jquery.peity.min.js"></script>
		<script src="__STATIC__/js/plugins/laydate/laydate.js"></script>
		<script src="__STATIC__/js/echarts.min.js"></script>
		<script>
            //手机适配
            $(function(){
                if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
                    $("head").append("<link>");
                    var css = $("head").children(":last");
                    css.attr({
                        rel:  "stylesheet",
                        type: "text/css",
                        href: "__STATIC__/css/phone_sp.css"
                    });
                    var mql = window.matchMedia("(orientation: portrait)");
                    if(mql.matches) { //竖屏样式
                        $(".vnl-zz").show();
                        $(".to-fdh").hide();
                    }else{
                        $(".to-fdh").show();
                        $("html").width("100%");
                        $("body").width("100%");
                    }
                    mql.addListener(function(m) {
                        if(m.matches) {
                            // 改变到直立方向
                            $(".vnl-zz").show();
                            $(".to-fdh").hide();
                        }
                        else {
                            $(".to-fdh").show();
                            $(".vnl-zz").hide();
                            $("html").width("100%");
                            $("body").width("100%");
                        }
                    });
                }
            });
            //导航显示展开
            $(".mob-nrdh").click(function(){
                $(this).next().toggle(".mob-nryc");
            });
            $(".to-imgd").click(function(){
                $(this).next().toggle(".mob-nrlb");
            });
            //手机适配end
			var typeID = "";
			$("#con_1").change(function() {
				typeID = $(this).val();
				if(typeID == "") {
					$(".ht_an_din").prop("checked", false);
					$(".ht_an_din1").prop("checked", false);
				} else if(typeID == 1) {
					$(".ht_an_din").prop("checked", true);
					$(".ht_an_din1").prop("checked", true);
					$("#manage").css("display", "block");
				} else {
					$(".ht_an_din").prop("checked", true);
					$("#manage").css("display", "none");
				}
			});
			//获取账号类型
			$(function() {
				$.ajax({
					type: "post",
					url: "__URL__/account_type",
					data: {},
					dataType: "json",
					success: function(e) {
						console.log(e);
						for(i in e) {
							$("#con_1").append("<option value='" + e[i].id + "'>" + e[i].title + "</option>");
						}
					},
					error: function(e) {
						console.log(e);
					}
				});
			});
            //地区
            $(function() {
                $.ajax({
                    type: "post",
                    url: "{:url('club/area')}",
                    data: {},
                    dataType: "json",
                    success: function(e) {
                        console.log(e);
                        for(i in e) {
                            $("#province").append( "<p class='province_nr pre_n1'><span>"+e[i].area_name+"</span><input type='checkbox' class='fa province_jt bxd_chox area' name='area' value='"+e[i].aid+"'></p>");

                        }
                    },
                    error: function(e) {
                        console.log(e);
                    }
                });
            });

            /*选择地区*/
            $("#button_ban_user").click(function() {
                var arr = new Array();
                $("input[type=checkbox].area").each(function() {
                    if($(this).prop("checked") == true){
                        // console.log($(this).val());
                        arr.push($(this).val());
					}
                });
                console.log(arr);
            });
            $("#all").click(function() {
                $("input[type=checkbox].area").each(function() {
                    // if(this.checked == true){
                    //     $(this).prop('checked', false);
                    // }else{
                    $(this).prop('checked', true);
                    // }

                });

            });
            $("#Uall").click(function() {
                $("input[type=checkbox].area").each(function() {
                    $(this).prop('checked', false);

                });

            });
            $("#cancel").click(function() {
                $("input[type=checkbox].area").each(function () {
                    $(this).attr('checked',false);
                });
            });
            //游戏
            $(function() {
                $.ajax({
                    type: "post",
                    url: "{:url('Account/Game')}",
                    data: {},
                    dataType: "json",
                    success: function(e) {
                        console.log(e);
                        for(i in e) {
                            $("#game").append( "<p class='province_nr pre_n1'><span>"+e[i].name+"</span><input type='checkbox' class='fa province_jt bxd_chox game' name='game' value='"+e[i].id+"'></p>");

                        }
                    },
                    error: function(e) {
                        console.log(e);
                    }
                });
            });
			/*选择游戏*/
            $("#button_ban_users").click(function() {
                var arr = new Array();
                $("input[type=checkbox].game").each(function() {
                    if($(this).prop("checked") == true){
                        // console.log($(this).val());
                        arr.push($(this).val());
                    }
                });
                console.log(arr);
            });
            $("#alls").click(function() {
                $("input[type=checkbox].game").each(function() {
                    // if(this.checked == true){
                    //     $(this).prop('checked', false);
                    // }else{
                    $(this).prop('checked', true);
                    // }

                });

            });
            $("#Ualls").click(function() {
                $("input[type=checkbox].game").each(function() {
                    $(this).prop('checked', false);

                });

            });
            $("#cancels").click(function() {
                $("input[type=checkbox].game").each(function () {
                    $(this).attr('checked',false);
                });
            });
			//注册账号
			function _checkedPost() {
					var arr = new Array();
                	$("input[type=checkbox].area").each(function() {
						if($(this).prop("checked") == true){
							arr.push($(this).val());
						}
					});
					var game = new Array();
					$("input[type=checkbox].game").each(function() {
						if($(this).prop("checked") == true){
                            game.push($(this).val());
						}
					});
					$.ajax({
						type: "post",
						url: "__URL__/account_register",
						data: {
							"account": $("#noticeTitle").val(), //账号
							"username": $("#noticeTitle1").val(), //姓名
							"phone": $("#noticeTitle2").val(), //手机
							"type": typeID, //账号类型
							'data':arr,
                            'game':game,
							"object_name": $("#noticeTitle1").val(), //操作对象名
							"actionname": 4 //操作名称
						},
						dataType: "json",
						success: function(e) {
							console.log(e);
							alert(e.msg);
							location.reload();
						},
						error: function(e) {}
					});
				// }
			}

			function _chooseGame(t) {
				//				console.log($(t).prop("checked"));
				//				console.log($(t).prop("value"));
				if($(t).prop("checked") == true) {
					//					console.log($(t).next().html());
					$("#gameOk").append('<p class="province_nr pre_n2 gameName" data-val="' + $(t).prop("value") + '"><span>' + $(t).next().html() + '</span><span class="fa fa-check-square-o province_jt"></span></p>')
				} else {
					var id = $(t).prop("value")
					//					console.log(id)
					$(".gameName").each(function() {
						if($(this).attr("data-val") == id) {
							$(this).remove()
						}
						//						console.log("取消"+$(this).attr("data-val"));
					});
				}
			}

			$('.pre_n1').click(function() {
				$('.pre_n1').css('background', '#fff');
				$('.pre_n1').css('color', '#6f6f6f');
				$(this).css('background', '#19a9d5');
				$(this).css('color', '#fff');
			});
			$('.pre_n2').click(function() {
				$('.pre_n2').css('background', '#fff');
				$('.pre_n2').css('color', '#6f6f6f');
				$(this).css('background', '#19a9d5');
				$(this).css('color', '#fff');
			});
			$('.pre_n3').click(function() {
				$('.pre_n3').css('background', '#fff');
				$('.pre_n3').css('color', '#6f6f6f');
				$(this).css('background', '#19a9d5');
				$(this).css('color', '#fff');
			});
			$(".form-tc").hide();
			$("#form_fd").mousemove(function() {
				$(".form-tc").show();
			});
			$("#form_fd").mouseout(function() {
				$(".form-tc").hide();
			});
			$("#btn_qx").click(function() {
				$("#tab-1 :checkbox").prop("checked", "true")
			})
			$("#btn_h1").click(function() {
				if($("#btn_h1").prop("checked")) {
					$("#btn_h1_1 :checkbox").prop("checked", "1");
				} else {
					$("#btn_h1_1 :checkbox").prop("checked", "");
				}
			})
			$("#btn_h2").click(function() {
				if($("#btn_h2").prop("checked")) {
					$("#btn_h1_2 :checkbox").prop("checked", "1");
				} else {
					$("#btn_h1_2 :checkbox").prop("checked", "");
				}
			})
			$("#btn_h3").click(function() {
				if($("#btn_h3").prop("checked")) {
					$("#btn_h1_3 :checkbox").prop("checked", "1");
				} else {
					$("#btn_h1_3 :checkbox").prop("checked", "");
				}
			})
		</script>

	</body>

</html>